<?php

class ShopController extends FrontController{

    public $layout = '//layouts/shop_column';
    protected $_provider;
    
    protected function beforeAction($action) {
    	$provider = $this->getProvider();
    	if (CHtml::value($provider, 'web.status') != 'ST_PASSED') {
    		throw new CHttpException(404,'店铺审核未通过');
    	}
		return true;
    }
    
	public function getProvider() {
		if (!is_object($this->_provider)) {
			$model = ProviderAccount::model()->findByPk(@$_GET['uid']);
			if (!is_object($model)) {
				throw new CHttpException(404);
			}
			$this->_provider = $model;
		}
		return $this->_provider;
	}
}

?>